Skip to content

Datepicker: Support parsing, formatting, and selecting four-digit years before year 100#1908

Open
wartmanm wants to merge 4 commits intojquery:mainfrom
wartmanm:7098
Open

Datepicker: Support parsing, formatting, and selecting four-digit years before year 100#1908
wartmanm wants to merge 4 commits intojquery:mainfrom
wartmanm:7098

Conversation

@wartmanm
Copy link
Copy Markdown

These changes should resolve https://bugs.jqueryui.com/ticket/7098, as well as improving formatting for years before 1000.

4-digit years, unix times, and windows times now handle years between 0 and
99.  Additionally, negative unix times can be parsed.
@jsf-clabot
Copy link
Copy Markdown

jsf-clabot commented Jan 22, 2020

CLA assistant check
All committers have signed the CLA.

Comment thread ui/widgets/datepicker.js
_formatYear: function( year ) {
var yearString = "" + year;
return year < 0 ? yearString :
yearString.length < 4 ? ( "0000" + yearString ).slice( -4 ) : yearString;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm honestly not sure how negative dates should be formatted.

Base automatically changed from master to main February 19, 2021 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants